using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class vPsdet_InventoryItemsMap : EntityTypeConfiguration<vPsdet_InventoryItems>
    {
        public vPsdet_InventoryItemsMap()
        {
            // Primary Key
            this.HasKey(t => new { t.PSID, t.ITEM, t.ExpiryDate });

            // Properties
            this.Property(t => t.ITEM)
                .IsRequired()
                .HasMaxLength(10);

            // Table & Column Mappings
            this.ToTable("vPsdet_InventoryItems");
            this.Property(t => t.PSID).HasColumnName("PSID");
            this.Property(t => t.ITEM).HasColumnName("ITEM");
            this.Property(t => t.QTYSHIP).HasColumnName("QTYSHIP");
            this.Property(t => t.ExpiryDate).HasColumnName("ExpiryDate");
        }
    }
}
